﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WcfContrib.Client.Behaviors
{
    /// <summary>
    /// Represents an interface for handling client invocation errors
    /// </summary>
    public interface IClientErrorHandler
    {
        /// <summary>
        /// Handle the error.
        /// </summary>
        /// <param name="clientChannel">The client channel.</param>
        /// <param name="context">The invocation context.</param>
        /// <param name="exception">The error.</param>
        void HandleError(ClientChannel clientChannel, ChannelInvokeContext context, Exception exception);

        /// <summary>
        /// Provide an exception to replace the original one.
        /// </summary>
        /// <param name="clientChannel">The client channel.</param>
        /// <param name="context">The invocation context.</param>
        /// <param name="exception">The exception.</param>
        void ProvideException(ClientChannel clientChannel, ChannelInvokeContext context, ref Exception exception);
    }
}
